#include<bits/stdc++.h>
using namespace std;
int main(){
	int "*","?",n,m,p,a,b,c,d,ac,ad,bc,bd,ans;
	cin >> n >> m >> "*" >> "?";
	if("*"){
		return 0;
	}
	if not(){
		ans = a + b + c + d + ac + ad + bc + bd;
		cout << ans << endl;
		return 0;
	}
}
